{include file=$header_start}
{strip}
<link rel="stylesheet" type="text/css" href="{$siteroot}/templates/default/style/registration.css">
<script type="text/javascript" src="{$siteroot}/includes/js/register.js"></script>
<script src="{$siteroot}/includes/js/admin/ajax.js" type="text/javascript" ></script>
{/strip}
{literal}
<script type="text/javascript">
function getSelectedCheckbox(buttonGroup) {
   // Go through all the check boxes. return an array of all the ones
   // that are selected (their position numbers). if no boxes were checked,
   // returned array will be empty (length will be zero)
   var retArr = new Array();
   var lastElement = 0;
   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].selected) {
            retArr.length = lastElement;
            retArr[lastElement] = i;
            lastElement++;
         }
      }
   } else { // There is only one check box (it's not an array)
      if (buttonGroup.selected) { // if the one check box is checked
         retArr.length = lastElement;
         retArr[lastElement] = 0; // return zero as the only array value
      }
   }
   return retArr;
} // Ends the "getSelectedCheckbox" function
  
  function getSelectedCheckboxValue(buttonGroup) {
   // return an array of values selected in the check box group. if no boxes
   // were checked, returned array will be empty (length will be zero)
   var retArr = new Array(); // set up empty array for the return values
   var selectedItems = getSelectedCheckbox(buttonGroup);
   if (selectedItems.length != 0) { // if there was something selected
      retArr.length = selectedItems.length;
      for (var i=0; i<selectedItems.length; i++) {
         if (buttonGroup[selectedItems[i]]) { // Make sure it's an array
            retArr[i] = buttonGroup[selectedItems[i]].value;
         } else { // It's not an array (there's just one check box and it's selected)
            retArr[i] = buttonGroup.value;// return that value
         }
      }
   }
   return retArr;
}


function showJobType(){
	//alert(document.getElementById("catname").value);
	
		var fl = 0;
	var chk_arr = new Array();
	var checkBoxArr = getSelectedCheckboxValue(document.frmTradesmanAdd.catname);	
	//alert(checkBoxArr);
	//document.getElementById('hidediv').style.display='block';
	ajax.sendrequest("GET",SITEROOT + "/modules/register/show_jobtype.php",{jid:checkBoxArr},"","isJobType");
}

</script>
{/literal}

{include file=$header_end}

<!-- MIDDLE CONTAIN GOES HERE -->
<section class="inner_wrapper">
<section class="middle_portion">
	<h1 class="registr_head">registration</h1>
    <section class="regis_steps_breadcrum_wrapper">
        <section class="lF"><img src="{$siteroot}/templates/default/images/registr_step1_ho.png"></section>
        <section class="lF"><img src="{$siteroot}/templates/default/images/registr_step2.png"></section>
        <section class="lF"><img src="{$siteroot}/templates/default/images/registr_step3.png"></section>
        <section class="lF"><img src="{$siteroot}/templates/default/images/registr_step4.png"></section>
        <section class="clear"></section>
    </section>    
        <span class="lF">
            <h2 class="heading2">Provider Registration</h2>    
        </span>                 
        <!--<span class="rF" style="padding-top:30px;" >"If you want to add more Service Category? Please completed your registration first." </span>-->
                    	 <section class="clear"></section>
        
    <form id="frmTradesmanAdd" name="frmTradesmanAdd" method="POST" action="{$siteroot}/register/step2/">   
    <section class="regist_form no_bor">
      <h1>select your trade</h1>
    	<dl>
                	<select class="input3" multiple="multiple" style="height:250px;" name="catname[]" id="catname" onchange="showJobType();">
                    	<!--<option value="">Select trade category</option>-->
                        {section name=i loop=$newtradecategoryArray}
                        	<option value="{$newtradecategoryArray[i].id}">{$newtradecategoryArray[i].trade_category}</option>
                        {/section} 
                    </select>
            <section class="clear"></section>
        </dl>
                <section class="clear"></section>
         <div id="hidediv" style="display:block;">       
        <h1 style="padding-top:35px;">select your skill</h1>
    	<dl>
           
                <div id="isJobType">
                	<select class="input3" multiple="multiple" name="jobtype[]" id="jobtype" style="height:250px;">                    	
                        {section name=i loop=$tradejobtypeArray}
                        	<option value="{$tradejobtypeArray[i].id}">{$tradejobtypeArray[i].trade_category}</option>
                        {/section} 
                    </select>
                 </div>   
            <section class="clear"></section>
        </dl>
		</div>

                <section class="clear"></section>
                
       </section> 
     <section><input type="submit" class="blue_btn margintp_bt rF" value="Next"  name="btnstep3" id="btnstep3"></section>
      <section class="clear"></section>
    </form>  
</section>
</section>
{include file=$footer}